-
Notifications
You must be signed in to change notification settings - Fork 860
[CI] Add Report Preview URLs Workflow #7524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CI] Add Report Preview URLs Workflow #7524
Conversation
感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-7524.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a GitHub Actions workflow to automatically generate and post preview URLs for documentation changes in pull requests. It creates a CI system that helps reviewers easily preview documentation modifications before they are merged.
- Adds a shell script to generate preview URLs for changed documentation files
- Creates a GitHub Actions workflow that triggers on documentation changes in PRs
- Includes a minor documentation fix for Chinese API documentation formatting
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
docs/api/paddle/abs_cn.rst | Minor formatting fix changing comma to "和" in Chinese parameter type list |
ci_scripts/report_preview_url.sh | Shell script to generate preview URLs for modified documentation files |
.github/workflows/preview-url-report.yml | GitHub Actions workflow to automatically post preview URLs in PR comments |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
db193cd
to
7a28dbd
Compare
@SigureMo 一师傅,我用了两个 workflow。评论需要写权限,一个流水线的话要用 pull_request_target trigger 才行,但是感觉用这个不安全。改成了只读的得到要 comment 的内容,触发实际 comment 的流水线,但是现在另外一个被流水线触发的 workflow run 流水线的日志得去点 action 才能看见,pr 下面的 check 不会显示 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一个流水线的话要用
pull_request_target
trigger 才行,但是感觉用这个不安全
pull_request_target
倒没什么,和 workflow_run
、comment
等一样必须合入后才会生效,因此不会有什么安全问题
不过我记得 pull_request_target
即便提 PR 的人有写权限,其携带的 GITHUB_TOKEN
也没有写权限,需要从该 repo 直接拉分支提 PR 才有,而如果是 forked repo 则仍然没有(可以参见 PyTorch 的开发方式与我们大有不同,PyTorch 有上千个开发分支,不是从 forked repo 拉分支开发的)
因此需要确定下:
- 是否
pull_request_target
限制一定比pull_request
+workflow_run
多? pull_request
+workflow_run
是否可以绕开上面说的 forked repo 所带来的限制?
我看了 https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request_target 这个文章,里面表达了一下事件的上下文这个概念,pull_request_target 会在 pr target 的上下文运行,这个时候的 GITHUB_TOKEN 是拥有写权限的,就相当于信任已经合入的内容。 |
嗯那没问题
这个是我记错了,这应该是 |
要是我把文档的修改拆出来是不是就可以合入啦(doge |
No description provided.